﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace TUIO
{
    [Serializable]
    public class ContactFrameReadyEventArgs : EventArgs
    {
        //[XmlArray]
        public List<TuioContact> NewContacts;
        //[XmlArray]
        public List<TuioContact> ExistingContacts;
        //[XmlArray]
        public List<TuioContact> RemovedContacts;
        //[XmlIgnore]
        //[XmlArray]
        public List<TuioContact> InactiveContacts;

        [XmlAttribute]
        public DateTime Time;
        [XmlAttribute]
        public string AdapterSource;
        [XmlAttribute]
        public long FrameNumber;

        private static long FrameCount;

        private ContactFrameReadyEventArgs()
        {
        }

        public ContactFrameReadyEventArgs(
            List<TuioContact> newContacts,
            List<TuioContact> existingContacts,
            List<TuioContact> removedContacts,
            List<TuioContact> inactiveContacts,
            DateTime time,
            string adapterSource)
        {
            this.NewContacts = newContacts;
            this.ExistingContacts = existingContacts;
            this.RemovedContacts = removedContacts;
            this.InactiveContacts = inactiveContacts;
            this.Time = time;
            this.AdapterSource = adapterSource;
            this.FrameNumber = FrameCount++;
        }
    }
}
